package com.cc.service.impl;

import com.cc.mapper.UserMapper;
import com.cc.model.EbUser;
import com.cc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserServiceImpl implements UserService{
        @Autowired
        private UserMapper userMapper;
        @Override
        public List<EbUser> list(int page, int pageSize){
            return  userMapper.findByPage((page-1)*pageSize,pageSize);
        }

        @Override
        public int getMaxPage(int pageSize) {
            return userMapper.getMaxPage(pageSize);
        }

    @Override
    public int save(EbUser ebUser) {
        return userMapper.save(ebUser);
    }
//    @Override
//    public EbUser checkUser(UserDto userDto){
//            return userMapper.checkUser(userDto);
//    }
@Override
  public EbUser checkUser(String userName,String passWord) {
    return userMapper.checkUser(userName,passWord);
}
    @Override
    public int deleteByPK(String  id) {
        return userMapper.deleteByPK(id);
    }
    @Override
    public EbUser selectByCondition(String euUserId) {

        return userMapper.selectById(euUserId);
    }
    @Override
    public int updateById(EbUser ebUser){
        return userMapper.updateByPrimaryKey(ebUser);
    }

    @Override
    public EbUser checkUser2(String euUserId) {
        return  userMapper.checkUser2(euUserId);
    }
}

